﻿using SD.ContentSystem.Domain.Entities;
using SD.ContentSystem.Domain.IRepositories.Interfaces;
using SD.Infrastructure.Repository.EntityFramework;
using System;
using System.Linq;
using System.Linq.Expressions;

namespace SD.ContentSystem.Repository.Implements
{
    /// <summary>
    /// 链接类别仓储实现
    /// </summary>
    public class LinkCategoryRepository : EFAggRootRepositoryProvider<LinkCategory>, ILinkCategoryRepository
    {
        #region # 根据条件获取实体对象集合（默认排序） —— override IOrderedQueryable<LinkCategory> FindBySort(...
        /// <summary>
        /// 根据条件获取实体对象集合（默认排序）
        /// </summary>
        /// <param name="condition">条件表达式</param>
        /// <returns>实体对象集合</returns>
        protected override IOrderedQueryable<LinkCategory> FindBySort(Expression<Func<LinkCategory, bool>> condition)
        {
            return base.Find(condition).OrderBy(x => x.Sort);
        }
        #endregion
    }
}
